package com.qkm.xinguan.controller;

import com.qkm.xinguan.domain.transform.dto.ComplaintDTO;
import com.qkm.xinguan.domain.transform.dto.TouristDTO;
import com.qkm.xinguan.response.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author zfj
 * @date 2022/1/28 -13:22
 * 投诉
 */
@RequestMapping("/business/complaint")
@Api(value = "投诉管理模块", tags = "投诉管理接口")
public interface IComplaintController {

	@PostMapping("/add")
	@ApiOperation(value = "添加投诉", notes = "投诉添加")
	Result addComplaint(@RequestBody @Validated ComplaintDTO complaintDTO, BindingResult result);

	@PostMapping("/update/{id}")
	@ApiOperation(value = "处理成功", notes = "处理投诉")
	Result update( @PathVariable("id") Long id);

	@GetMapping("/all")
	@PreAuthorize("hasAuthority('complaint:list')")
	@ApiOperation(value = "分页获取房屋列表信息", notes = "分页")
	Result getAllList(@RequestParam(required = false, value = "page", defaultValue = "1") Integer page,
	                      @RequestParam(required = false, value = "size", defaultValue = "100") Integer size);

	@GetMapping("/all/{id}")
	@ApiOperation(value = "游客id找投诉", notes = "游客id找订单")
	Result getAllListById(@PathVariable("id") Long id);

	@DeleteMapping("/delete/{id}")
	@ApiOperation(value = "删除投诉投诉", notes = "删除投诉")
	Result deleteById(@PathVariable("id") Long id);

}
